

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>jump command &mdash; LIGGGHTS v3.X documentation</title>
  

  
  
  
  

  

  
  
    

  

  
  
    <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  

  

  
    <link rel="top" title="LIGGGHTS v3.X documentation" href="index.html"/> 

  
  <script src="_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="Manual.html" class="icon icon-home"> LIGGGHTS
          

          
          </a>

          
            
            
              <div class="version">
                v3.X
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_input_script.html">3. Input Script</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">4. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_gran_models.html">5. Contact models</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_mesh_modules.html">6. Mesh modules</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">7. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">8. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">9. Modifying &amp; extending LIGGGHTS(R)-PUBLIC</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">10. Python interface to LIGGGHTS(R)-PUBLIC</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">11. Errors</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="Manual.html">LIGGGHTS</a>
        
      </nav>


      
      <div class="wy-nav-content">
        <div class="rst-content">
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="Manual.html">Docs</a> &raquo;</li>
        
      <li>jump command</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="_sources/jump.txt" rel="nofollow"> View page source</a>
          
          <a href="http://www.cfdem.com"> Website</a>
          
            <a href="Section_commands.html#comm" rel="nofollow"> Commands</a>
            
          
        
      </li>
    
  </ul>

  
  <hr/>
  
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="jump-command">
<span id="index-0"></span><h1>jump command<a class="headerlink" href="#jump-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>jump file label
</pre></div>
</div>
<ul class="simple">
<li>file = filename of new input script to switch to</li>
<li>label = optional label within file to jump to</li>
</ul>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>jump newfile
jump in.run2 runloop
jump SELF runloop
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>This command closes the current input script file, opens the file with
the specified name, and begins reading LIGGGHTS(R)-PUBLIC commands from that file.
Unlike the <a class="reference internal" href="include.html"><em>include</em></a> command, the original file is not
returned to, although by using multiple jump commands it is possible
to chain from file to file or back to the original file.</p>
<p>If the word &#8220;SELF&#8221; is used for the filename, then the current input
script is re-opened and read again.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">The SELF option is not guaranteed to work when the
current input script is being read through stdin (standard input),
e.g.</p>
</div>
<div class="highlight-python"><div class="highlight"><pre>lmp_g++ &lt; in.script
</pre></div>
</div>
<p>since the SELF option invokes the C-library rewind() call, which may
not be supported for stdin on some systems.  This can be worked around
by using the <a class="reference internal" href="Section_start.html#start-7"><span>-in command-line argument</span></a> or
the <a class="reference internal" href="Section_start.html#start-7"><span>-var command-line argument</span></a> to pass
the script name as a variable to the input script In the latter case,
the &#8220;fname&#8221; <a class="reference internal" href="variable.html"><em>variable</em></a> could be used in place of SELF.
E.g.</p>
<div class="highlight-python"><div class="highlight"><pre>lmp_g++ -in in.script
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre>lmp_g++ -var fname n.script &lt; in.script
</pre></div>
</div>
<p>The 2nd argument to the jump command is optional.  If specified, it is
treated as a label and the new file is scanned (without executing
commands) until the label is found, and commands are executed from
that point forward.  This can be used to loop over a portion of the
input script, as in this example.  These commands perform 10 runs,
each of 10000 steps, and create 10 dump files named file.1, file.2,
etc.  The <a class="reference internal" href="next.html"><em>next</em></a> command is used to exit the loop after 10
iterations.  When the &#8220;a&#8221; variable has been incremented for the tenth
time, it will cause the next jump command to be skipped.</p>
<div class="highlight-python"><div class="highlight"><pre>variable a loop 10
label loop
dump 1 all atom 100 file.$a
run 10000
undump 1
next a
jump in.lj loop
</pre></div>
</div>
<p>If the jump <em>file</em> argument is a variable, the jump command can be
used to cause different processor partitions to run different input
scripts.  In this example, LIGGGHTS(R)-PUBLIC is run on 40 processors, with 4
partitions of 10 procs each.  An in.file containing the example
variable and jump command will cause each partition to run a different
simulation.</p>
<div class="highlight-python"><div class="highlight"><pre>mpirun -np 40 lmp_ibm -partition 4x10 -in in.file
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre>variable f world script.1 script.2 script.3 script.4
jump $f
</pre></div>
</div>
<p>Here is an example of a double loop which uses the <a class="reference internal" href="if.html"><em>if</em></a> and
jump commands to break out of the inner loop when a condition is met,
then continues iterating thru the outer loop.</p>
<div class="highlight-python"><div class="highlight"><pre>label            loopa
variable    a loop 5
  label          loopb
  variable  b loop 5
  print          &quot;A,B = $a,$b&quot;
  run       10000
  if     $b &gt; 2 then &quot;jump in.script break&quot;
  next           b
  jump           in.script loopb
label            break
variable    b delete
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre>next     a
jump     in.script loopa
</pre></div>
</div>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<p>If you jump to a file and it does not contain the specified label,
LIGGGHTS(R)-PUBLIC will come to the end of the file and exit.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="variable.html"><em>variable</em></a>, <a class="reference internal" href="include.html"><em>include</em></a>, <a class="reference internal" href="label.html"><em>label</em></a>,
<a class="reference internal" href="next.html"><em>next</em></a></p>
<p><strong>Default:</strong> none</p>
</div>
</div>


           </div>
           <div class="articleComments">
            
           </div>
          </div>
          <footer>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2016, DCS Computing GmbH, JKU Linz and Sandia Corporation.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'./',
            VERSION:'v3.X',
            LANGUAGE:'None',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true,
            SOURCELINK_SUFFIX: ''
        };
    </script>
      <script type="text/javascript" src="_static/jquery.js"></script>
      <script type="text/javascript" src="_static/underscore.js"></script>
      <script type="text/javascript" src="_static/doctools.js"></script>

  

  
  
    <script type="text/javascript" src="_static/js/theme.js"></script>
  

  
  
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
   

</body>
</html>